const parseUrl = (req) => {
    //获取前端传递的参数
    return req.method == "POST" ? req.body : this.urlSplit(req.url);
}
const urlSplit = (url) => {
    //get获取的参数解析
    let list = url.split("?")[1].split("&");
    let leng = list.length;
    let obj = {};
    for (let i = 0; i < leng; i++) {
        let key = list[i].split("=")[0];
        let val = list[i].split("=")[1];
        obj[key] = val;
    }
    return obj;
}
module.exports = {
    parseUrl,
    urlSplit
}